﻿package com.htmlparser;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

import org.jdom.Document;
import com.pc.util.http.PCHttp;

public class RunScriptFileDemo {
  public static void main(String[] args) {
//    ScriptEngineManager manager = new ScriptEngineManager();
//    ScriptEngine engine = manager.getEngineByName("js");
//    Window window = new Window();
//	//Window.Location location = window.new Location();
//	Location location = new Location();
//	Document document = new Document();
//	engine.put("window", window);
//	engine.put("location", location);
//	engine.put("document", document);
//    try {
//      //FileReader reader = new FileReader("yourFile.js");
//      //String result = (String)engine.eval("var u = 'http://www.baidu.com';window.open(u,'heihei...','haha...');");
//      String result = (String)engine.eval("location.href = 'http://www.hao123.com';");
//      System.out.println("result = " + result);
//      //reader.close();
//    } catch (Exception e) {
//      e.printStackTrace();
//    }
    
    //Object o = new Integer(9);
//    Object o = new String("mashenghai");
//    String temp = o.getClass().toString();
//    
//    String s = temp.substring(temp.lastIndexOf(".")+1,temp.length());
//    System.out.println("o.getClass()=="+s+"==");
	  
	 String login =  PCHttp.login("chengyongbing","USERNAME=chengyongbing&PASSWORD=000000",0,"/logincheck.php","GBK");
	 if(login.indexOf("用户名或密码错误")==-1){
		 System.out.println("恭喜你，登陆成功！");
	 }else{
		 System.out.println("登陆失败！");
	 }
	 System.out.println("login=="+login+"==");
	 
  }
}

